package com.count.core;

public class GTextInfo {
	private String title;
	private String gameStr;

	private String preflopStr;
	private String flopStr;
	private String riverStr;
	private String turnStr;
	private String summaryStr;
	private String showDownStr;

	public String getPreflopStr() {
		return preflopStr;
	}

	public void setPreflopStr(String gameStr) {
		if (gameStr.indexOf("*** FLOP *** [") > -1) {
			preflopStr = gameStr.substring(0, gameStr.indexOf("*** FLOP ***"));
		} else {
			preflopStr = gameStr.substring(0, gameStr.indexOf("*** SUMMARY ***"));
		}
	}

	public String getSummaryStr() {
		return summaryStr;
	}

	public void setSummaryStr(String gameStr) {
		summaryStr = gameStr.substring(gameStr.indexOf("*** SUMMARY ***"), gameStr.length() - 1);
	}

	public String getShowDownStr() {
		return showDownStr;
	}

	public void setShowDownStr(String gameStr) {
		showDownStr = gameStr.substring(gameStr.indexOf("*** SHOW DOWN ***"), gameStr.indexOf("*** SUMMARY ***"));
	}

	public String getFlopStr() {
		return flopStr;
	}

	public String getRiverStr() {
		return riverStr;
	}

	public void setRiverStr(String gameStr) {
		if (gameStr.indexOf("*** SHOW DOWN ***") > -1) {
			riverStr = gameStr.substring(gameStr.indexOf("*** RIVER ***"), gameStr.indexOf("*** SHOW DOWN ***"));
		} else {
			riverStr = gameStr.substring(gameStr.indexOf("*** RIVER ***"), gameStr.indexOf("*** SUMMARY ***"));
		}
	}

	public String getTurnStr() {
		return turnStr;
	}

	public void setTurnStr(String gameStr) {
		if (gameStr.indexOf("*** RIVER ***") > -1) {
			turnStr = gameStr.substring(gameStr.indexOf("*** TURN ***"), gameStr.indexOf("*** RIVER ***"));
		} else {
			turnStr = gameStr.substring(gameStr.indexOf("*** TURN ***"), gameStr.indexOf("*** SUMMARY ***"));
		}
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getGameStr() {
		return gameStr;
	}

	public void setGameStr(String gameStr) {
		this.gameStr = gameStr;
		setPreflopStr(gameStr);

		if (gameStr.indexOf("*** FLOP ***") > -1) {
			setFlopStr(gameStr);
		}
		if (gameStr.indexOf("*** TURN ***") > -1) {
			setTurnStr(gameStr);
		}
		if (gameStr.indexOf("*** RIVER ***") > -1) {
			setRiverStr(gameStr);
		}
		if (gameStr.indexOf("*** SHOW DOWN ***") > -1) {
			setShowDownStr(gameStr);
		}

		setSummaryStr(gameStr);
	}

	private void setFlopStr(String gameStr) {
		if (gameStr.indexOf("*** TURN ***") > -1) {
			flopStr = gameStr.substring(gameStr.indexOf("*** FLOP ***"), gameStr.indexOf("*** TURN ***"));
		} else {
			flopStr = gameStr.substring(gameStr.indexOf("*** FLOP ***"), gameStr.indexOf("*** SUMMARY ***"));
		}

	}
}
